//
//  FFDynamicFormFactory.m
//  FFSurveillance
//
//  Created by roro_latrobe on 16/11/1.
//  Copyright © 2016年 cn.wanda. All rights reserved.
//

#import "FFDynamicFormFactory.h"
#import "FFFormDataSource.h"
#import "FFRemoteFormDataSource.h"
#import "FFLocalFormDataSource.h"
#import "FFPlistManager.h"

@implementation FFDynamicFormFactory

//FF_DEF_SINGLETON1(FFDynamicFormFactory)

+ (FFDynamicFormFactory *)sharedFactory {
    static FFDynamicFormFactory *kInstance = nil;
    @synchronized(self){
        if(!kInstance){
            kInstance = [[FFDynamicFormFactory alloc] init];
        }
    }
    return kInstance;
}

- (FFDynamicForm *)createDynamicForm:(NSString *)type readDataCompleted:(GetFormDataCompletion)completionBlock {
    return nil;
}

- (FFDynamicForm *)createDynamicForm:(NSString *)configName {
    FFPlistManager *plistMgr = [FFPlistManager new];
    NSDictionary *formDataDic = [plistMgr readDataFromPlist:configName];
    return [FFDynamicForm modelWithJSONDictionary:formDataDic];
}

@end
